/**
 * 
 */
package com.p2p.base.constents;

import java.util.Map;

import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;

import com.p2p.base.exception.BizException;

/**
 * @author ruiqi
 *
 */
public class InnerAccountConsts {
	
	//内部投标归集账户
	public static String innerTenderAccountNo;// = "17880300000000060156";
	
	//内部中间账户
	public static String innerMiddleAccountNo;// = "17880300008888880156";
	
	//内部收费账户
	public static String innerChargeAccountNo;// = "17880300000000020156";

	//总账账户
	public static String innerTotalAccountNo;// = "17880300000000740156";
	
	public  static void init(Map<String, String> map){
		String innerTenderAccountNoName = "innerTenderAccountNo";
		String innerMiddleAccountNoName = "innerMiddleAccountNo";
		String innerChargeAccountNoName = "innerChargeAccountNo";
		String innerTotalAccountNoName = "innerTotalAccountNo";
		
		innerTenderAccountNo=MapUtils.getString(map, innerTenderAccountNoName);
		innerMiddleAccountNo=MapUtils.getString(map, innerMiddleAccountNoName);
		innerChargeAccountNo=MapUtils.getString(map, innerChargeAccountNoName);	
		innerTotalAccountNo=MapUtils.getString(map, innerTotalAccountNoName);
		if(StringUtils.isBlank(innerTenderAccountNo)){
			throw new BizException("ACCOUNT_INIT_ERROR",innerTenderAccountNoName);
		}
		if(StringUtils.isBlank(innerMiddleAccountNo)){
			throw new BizException("ACCOUNT_INIT_ERROR",innerMiddleAccountNoName);
		}
		if(StringUtils.isBlank(innerChargeAccountNo)){
			throw new BizException("ACCOUNT_INIT_ERROR",innerChargeAccountNoName);
		}
		if(StringUtils.isBlank(innerTenderAccountNo)){
			throw new BizException(innerTotalAccountNoName,innerTotalAccountNoName);
		}
	}

	public String getInnerTenderAccountNo() {
		return innerTenderAccountNo;
	}

	public void setInnerTenderAccountNo(String innerTenderAccountNo) {
		InnerAccountConsts.innerTenderAccountNo = innerTenderAccountNo;
	}

	public String getInnerMiddleAccountNo() {
		return innerMiddleAccountNo;
	}

	public void setInnerMiddleAccountNo(String innerMiddleAccountNo) {
		InnerAccountConsts.innerMiddleAccountNo = innerMiddleAccountNo;
	}

	public String getInnerChargeAccountNo() {
		return innerChargeAccountNo;
	}

	public void setInnerChargeAccountNo(String innerChargeAccountNo) {
		InnerAccountConsts.innerChargeAccountNo = innerChargeAccountNo;
	}

	public static String getInnerTotalAccountNo() {
		return innerTotalAccountNo;
	}

	public static void setInnerTotalAccountNo(String innerTotalAccountNo) {
		InnerAccountConsts.innerTotalAccountNo = innerTotalAccountNo;
	}
	
}
